<template>
    <div>
        <square-button icon="el-icon-top" slot="reference" :title="title" v-on="$listeners"  v-bind="$attrs" @click="getUploadDialog"></square-button>
        <upload-dialog  :visible.sync="visible" v-if="visible" :id="row.id"></upload-dialog>
    </div>
</template>
<script>
    import SquareButton from "../SquareButton";
    import UploadDialog from "./UploadDialog";
    export default {
        name:"UploadButton",
        components: {UploadDialog, SquareButton},
        props:{
            title:{
                type:String,
                default:"上传文件"
            },
            row:{
                type:Object,
                default:function () {
                    return {}
                }
            }
        },
        data(){
          return{
              visible:false
          }
        },
        created() {
        },
        computed:{
        },
        methods:{
            getUploadDialog(){
                this.visible = true
            }
        }
    }
</script>
<style scoped>
</style>
